package com.lebang.entity.task;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.lebang.domain.TaskTagRelation;
import com.lebang.model.enums.buss.TaskCategory;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

import lombok.Data;

/**
 * task_screenshot
 * @author 
 */
@Data
@ApiModel("")
public class TaskScreenshot implements Serializable {
    /**
     * id
     */
    @ApiModelProperty("id")
    private Long id;

    /**
     * 创建时间
     */
    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    @ApiModelProperty("修改时间")
    private LocalDateTime modifyTime;

    /**
     * 是否删除
     */
    @ApiModelProperty("是否删除")
    private String hasDeleted;

    /**
     * 任务id
     */
    @ApiModelProperty("任务id")
    private String taskId;

    /**
     * 图标
     */
    @ApiModelProperty("图标")
    private String icon;

    /**
     * 标题
     */
    @ApiModelProperty("标题")
    private String title;

    /**
     * 总量
     */
    @ApiModelProperty("总量")
    private Integer total;

    /**
     * 每日量
     */
    @ApiModelProperty("每日量")
    private Integer amount;

    /**
     * 展示价
     */
    @ApiModelProperty("展示价")
    private String label;

    /**
     * 类型
     */
    @ApiModelProperty("类型")
    private String type;

    /**
     * 奖励值
     */
    @ApiModelProperty("奖励值")
    private String worth;

    /**
     * 客户
     */
    @ApiModelProperty("客户")
    private String customer;

    /**
     * 排序
     */
    @ApiModelProperty("排序")
    private Integer sort;

    /**
     * 任务预计耗时(分钟)
     */
    @ApiModelProperty("任务预计耗时(分钟)")
    private Integer taskTime;

    /**
     * 承诺审核时间(分钟)
     */
    @ApiModelProperty("承诺审核时间(分钟)")
    private Integer auditTime;

    /**
     * 是否能重做1能0不能
     */
    @ApiModelProperty("是否能重做1能0不能")
    private Integer redo;

    /**
     * 今日完成数
     */
    @ApiModelProperty("今日完成数")
    private Integer todayAmount;

    /**
     * 任务失败功数
     */
    @ApiModelProperty("任务失败功数")
    private Integer failCount;

    /**
     * 任务成功数
     */
    @ApiModelProperty("任务成功数")
    private Integer successCount;

    /**
     * 任务要求
     */
    @ApiModelProperty("任务要求")
    private String mission;

    /**
     * 用户拥有最小金额(分)
     */
    @ApiModelProperty("用户拥有最小金额(分)")
    private Integer minMoney;

    /**
     * 自动上架时间
     */
    @ApiModelProperty("自动上架时间")
    private String autoTime;

    /**
     * 自动下架时间
     */
    @ApiModelProperty("自动下架时间")
    private String autoOffTime;

    /**
     * 可获得奖励倍数
     */
    @ApiModelProperty("可获得奖励倍数")
    private Integer awardMultiple;

    /**
     * 失败可重做次数
     */
    @ApiModelProperty("失败可重做次数")
    private Integer failTimes;

    /**
     * 任务分类id
     */
    @ApiModelProperty("任务分类id")
    private Integer taskCategoryId;

    /**
     * 任务简介
     */
    @ApiModelProperty("任务简介")
    private String taskIntroduce;

    /**
     * 任务备注
     */
    @ApiModelProperty("任务备注")
    private String taskRemarks;

    /**
     * 状态
     */
    @ApiModelProperty("状态")
    private String status;

    /**
     * 渠道
     */
    @ApiModelProperty("渠道")
    private String channel;

    /**
     * Fixed：固定值；Random：随机值；Rate：按比例
     */
    @ApiModelProperty("Fixed：固定值；Random：随机值；Rate：按比例")
    private String reward;

    /**
     * 客户价格
     */
    @ApiModelProperty("客户价格")
    private Integer increase;

    /**
     * 任务自动释放时间
     */
    @ApiModelProperty("任务自动释放时间")
    private Integer releaseTime;

    /**
     * 任务类型
     */
    @ApiModelProperty("任务类型")
    private String category;

    /**
     * 0通用1多词
     */
    @ApiModelProperty("0通用1多词")
    private Integer isMultiword;

    /**
     * 分享简介
     */
    @ApiModelProperty("分享简介")
    private String shareIntroduce;

    //标签id
    private List<TaskTagRelation> taskTagRelationList;
    private Integer taskTagId;

    //页面传入带,隔开的标签字符串
    private String taskTagIds;

    private static final long serialVersionUID = 1L;

    public TaskScreenshot() {
    }

    public TaskScreenshot(TaskComments s) {
        this.createTime = LocalDateTime.now();
        this.modifyTime = LocalDateTime.now();
        if(s.getHasDeleted()==0){
            this.hasDeleted = "False";
        }
        if(s.getHasDeleted()==1){
            this.hasDeleted = "True";
        }
        this.taskId = s.getTaskId();
        this.icon = s.getIcon();
        this.title = s.getTitle();
        this.total = s.getTotal();
        this.amount = s.getAmount();
        this.label = s.getLabel();
        this.type = s.getType().name();
        this.worth = s.getWorth().toString();
        this.customer = s.getCustomer();
        this.sort = s.getSort();
        this.taskTime = s.getTaskTime();
        this.auditTime = s.getAuditTime();
        this.redo = s.getRedo();
        this.todayAmount = s.getTodayAmount();
        this.failCount = s.getFailCount();
        this.successCount = s.getSuccessCount();
        this.mission = s.getMission();
        this.minMoney = s.getMinMoney();
        this.autoTime = s.getAutoTime();
        this.autoOffTime = s.getAutoOffTime();
        this.awardMultiple = 1;
        this.failTimes = 0;
        this.taskCategoryId = 0;
        this.taskIntroduce = "";
        this.taskRemarks = "";
        this.shareIntroduce = "";
        if(s.getStatus()==0){
            this.status = "Off";
        }
        if(s.getStatus()==1){
            this.status = "On";
        }
        if(s.getStatus()==2){
            this.status = "Wait";
        }
        this.channel = s.getBrand();
        this.category = TaskCategory.Comments.name();
        this.isMultiword=0;
    }

    public TaskScreenshot(LbbCommon s) {
        this.createTime = LocalDateTime.now();
        this.modifyTime = LocalDateTime.now();
        this.hasDeleted = s.getHasDeleted();
        this.taskId = s.getTaskId();
        this.icon = s.getIcon();
        this.title = s.getTitle();
        this.total = s.getTotal();
        this.amount = s.getAmount();
        this.label = s.getLabel();
        this.type = s.getType().name();
        this.worth = s.getWorth();
        this.customer = s.getCustomer();
        this.sort = s.getSort();
        this.taskTime = s.getTaskTime();
        this.auditTime = s.getAuditTime();
        this.redo = s.getRedo();
        this.todayAmount = s.getTodayAmount();
        this.failCount = s.getFailCount();
        this.successCount = s.getSuccessCount();
        this.mission = s.getMission();
        this.minMoney = s.getMinMoney();
        this.autoTime = s.getAutoTime();
        this.autoOffTime = s.getAutoOffTime();
        this.awardMultiple = 1;
        this.failTimes = 0;
        this.taskCategoryId = 0;
        this.taskIntroduce = "";
        this.taskRemarks = "";
        this.status = s.getStatus().name();
        this.channel = s.getChannel();
        this.reward = s.getReward().name();
        this.increase = s.getIncrease();
        this.releaseTime = s.getReleaseTime();
        this.category = TaskCategory.Common.name();
        this.shareIntroduce = "";
        if(s.getIsMultiword()!=null&&s.getIsMultiword()==1){
            this.isMultiword=1;
        }else{
            this.isMultiword=0;
        }
    }

    public TaskScreenshot(LbbSosoWithBLOBs s) {
        this.createTime = LocalDateTime.now();
        this.modifyTime = LocalDateTime.now();
        this.hasDeleted = s.getHasDeleted();
        this.taskId = s.getTaskId();
        this.icon = s.getIcon();
        this.title = s.getTitle();
        this.total = s.getTotal();
        this.amount = s.getAmount();
        this.label = s.getLabel();
        this.type = s.getType().name();
        this.worth = s.getWorth();
        this.customer = s.getCustomer();
        this.sort = s.getSort();
        this.taskTime = s.getTaskTime();
        this.auditTime = s.getAuditTime();
        this.redo = s.getRedo();
        this.todayAmount = s.getTodayAmount();
        this.failCount = s.getFailCount();
        this.successCount = s.getSuccessCount();
        this.mission = s.getMission();
        this.minMoney = s.getMinMoney();
        this.autoTime = s.getAutoTime();
        this.autoOffTime = s.getAutoOffTime();
        this.awardMultiple = 1;
        this.failTimes = 0;
        this.taskCategoryId = 0;
        this.taskIntroduce = "";
        this.taskRemarks = "";
        this.status = s.getStatus().name();
        this.channel = s.getChannel();
        this.reward = s.getReward().name();
        this.increase = s.getIncrease();
        this.category = TaskCategory.Soso.name();
        this.isMultiword=0;
        this.shareIntroduce = "";
    }

}